package com.manpower.model;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * MpPopedom entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "mp_popedom", catalog = "manpower")
public class MpPopedom implements java.io.Serializable {

	// Fields

	private String id;
	private MpPopedom mpPopedom;
	private String popedomName;
	private String popedomUrl;
	private String popedomIcon;
	private Set<MpRolePopedom> mpRolePopedoms = new HashSet<MpRolePopedom>(0);
	private Set<MpPopedom> mpPopedoms = new HashSet<MpPopedom>(0);

	// Constructors

	/** default constructor */
	public MpPopedom() {
	}

	/** minimal constructor */
	public MpPopedom(String id) {
		this.id = id;
	}

	/** full constructor */
	public MpPopedom(String id, MpPopedom mpPopedom, String popedomName,
			String popedomUrl, String popedomIcon,
			Set<MpRolePopedom> mpRolePopedoms, Set<MpPopedom> mpPopedoms) {
		this.id = id;
		this.mpPopedom = mpPopedom;
		this.popedomName = popedomName;
		this.popedomUrl = popedomUrl;
		this.popedomIcon = popedomIcon;
		this.mpRolePopedoms = mpRolePopedoms;
		this.mpPopedoms = mpPopedoms;
	}

	// Property accessors
	@Id
	@Column(name = "id", unique = true, nullable = false, length = 36)
	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "popedom_parent")
	public MpPopedom getMpPopedom() {
		return this.mpPopedom;
	}

	public void setMpPopedom(MpPopedom mpPopedom) {
		this.mpPopedom = mpPopedom;
	}

	@Column(name = "popedom_name", length = 200)
	public String getPopedomName() {
		return this.popedomName;
	}

	public void setPopedomName(String popedomName) {
		this.popedomName = popedomName;
	}

	@Column(name = "popedom_url", length = 200)
	public String getPopedomUrl() {
		return this.popedomUrl;
	}

	public void setPopedomUrl(String popedomUrl) {
		this.popedomUrl = popedomUrl;
	}

	@Column(name = "popedom_icon", length = 200)
	public String getPopedomIcon() {
		return this.popedomIcon;
	}

	public void setPopedomIcon(String popedomIcon) {
		this.popedomIcon = popedomIcon;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "mpPopedom")
	public Set<MpRolePopedom> getMpRolePopedoms() {
		return this.mpRolePopedoms;
	}

	public void setMpRolePopedoms(Set<MpRolePopedom> mpRolePopedoms) {
		this.mpRolePopedoms = mpRolePopedoms;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "mpPopedom")
	public Set<MpPopedom> getMpPopedoms() {
		return this.mpPopedoms;
	}

	public void setMpPopedoms(Set<MpPopedom> mpPopedoms) {
		this.mpPopedoms = mpPopedoms;
	}

}